<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="./vue.js"></script>
  </head>
  <body>
    <div id="app">
      <!-- <span v-for="hehe,xixi in arr">
      {{xixi}}.{{hehe}}
    </span> -->
      <!-- <ul>
      <li v-for="item,index in arr">
        {{index}}.{{item}}
      </li>
    </ul> -->
      <!-- <ul>
        <li v-for="item,index of arr">{{index}}.{{item}}</li>
      </ul> -->
      <!-- 循环对象 -->
      <!-- <ul>
        <li v-for="val,key,index in obj">
          {{index}}. {{key}} === {{val}}
        </li>
      </ul> -->
      <!-- 循环数字 -->
      <!-- <ul>
        <li v-for="item,index in num">
          {{index}}.{{item}}
        </li>
      </ul> -->
      <!-- 循环字符串 -->
      <ul>
        <li v-for="item,index in string" :key="index">
          {{index}}.{{item}}
        </li>
      </ul>
    </div>

    <script>
      /*
    v-for 列表渲染 根据数据重复创建绑定的元素 
    v-for="每一项的值,下标 in/of  数据源"
    v-for="item,index in arr"
    循环的时候需要给每一个对象添加一个标识（唯一不重复） 选用下标
    */
      new Vue({
        el: "#app",
        data: {
          string: "贞子大战伽椰子",
          num: 100,
          arr: [1, 2, 3],
          obj: { us: "韩梅梅", ps: 123, sex: 0 },
        },
      });
    </script>
  </body>
</html>
